<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="am-cf">
	共 ${page.total } 条记录
	<div class="am-fr">
		<input type="hidden" id="current" name="current" value="${page.current}" />
		<input type="hidden" name="pages" value="${page.pages}" />
		<input type="hidden" name="total" value="${page.total}" />
		<ul class="am-pagination">
			<c:if test="${page.pages>1}">
			<li>
				第<input type="number" min="1" style="width: 50px;text-align:center" id="num" value="${page.current}">页
			</li>
			<li>
				<a href="javascript:void(0);" onclick="jump();">跳</a>
			</li>
			<li>
				<a href="javascript:void(0);" onclick="_this._ajaxList('1')">首页</a>
			</li>
			</c:if>
			<c:if test="${page.current>1}">
				<li><a  href="javascript:_this._ajaxList(${page.current-1})">上一页</a></li></c:if>
			<c:if test="${page.current <= 1}">
				<li><a  href="javascript:_this._ajaxList(1)">上一页</a></li></c:if>
			<c:if test="${page.current<page.pages}">
				<li>
			<a  href="javascript:_this._ajaxList(${page.current+1})">下一页</a></li></c:if>
			<c:if test="${page.current >= page.pages}">
				<li><a  href="javascript:_this._ajaxList(${page.current})">下一页</a></li>
			</c:if>
			<c:if test="${page.current<page.pages}">
				<li>
					<a  href="javascript:_this._ajaxList(${page.pages})">尾页</a></li></c:if>
			<c:if test="${page.current == page.pages}">
				<li><a  href="javascript:_this._ajaxList(${page.current})">尾页</a></li></c:if>
		</ul>
	</div>
</div>
<script type="text/javascript">
var jump = function(){
	var num = $('#num').val();
	if(num==""||isNaN(num)||num<=0){
		layer.alert("请输入正确的页码");
		return;
	}
	num = parseInt(num);
	var total = parseInt("${page.pages}");
	if(num<0||num>total){
		_this._ajaxList('1');
	}else{
		_this._ajaxList(num);
	}
}
</script>